package cn.edu.ctbu.lab.service;


import cn.edu.ctbu.lab.domain.Teacher;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public interface TeacherService {
    public Optional<Teacher> findById(Integer id);
    public List<Teacher> findAll();
    public Page<Teacher> findByPage(int pageIndex, int pageSize);
    public Teacher add(Teacher teacher);
    public Teacher update(Teacher teacher);
    public int delete(Teacher teacher);
    public  int delete(Integer id);

    /**
     *
     * @param name
     * @param password
     * @return
     */
    public Teacher validNoAndPassword(String name,String password) throws  Exception;

    List<Teacher> findByNameAndPage(String name);
}
